package com.gwtgeo.ui.shared.event;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.google.gwt.event.shared.GwtEvent;
import com.gwtgeo.ui.client.mvp.windowsmanager.WindowTypeEnum;

public class CloseWinModalEvent extends GwtEvent<CloseWinModalEventHandler> {

	public static Type<CloseWinModalEventHandler> TYPE = new Type<CloseWinModalEventHandler>();

	private WindowTypeEnum type;

	private List<WindowTypeEnum> receptors = new ArrayList<WindowTypeEnum>();

	private Map<String, Object> data;

	public CloseWinModalEvent() {
		super();
	}

	public CloseWinModalEvent(WindowTypeEnum type) {
		super();
		this.type = type;
	}

	public CloseWinModalEvent(WindowTypeEnum type, WindowTypeEnum receptor,
			Map<String, Object> data) {
		super();
		this.type = type;
		this.receptors.add(receptor);
		this.data = data;
	}

	public CloseWinModalEvent(WindowTypeEnum type,
			List<WindowTypeEnum> receptors, Map<String, Object> data) {
		super();
		this.type = type;
		this.receptors = receptors;
		this.data = data;
	}

	@Override
	protected void dispatch(CloseWinModalEventHandler handler) {
		handler.onCloseWinModal(this);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<CloseWinModalEventHandler> getAssociatedType() {
		return TYPE;
	}

	public WindowTypeEnum getType() {
		return type;
	}

	public List<WindowTypeEnum> getReceptors() {
		return receptors;
	}

	public Map<String, Object> getData() {
		return data;
	}

}
